package br.eng.megaprojetos.view;

import org.springframework.context.annotation.Scope;
import org.zkoss.zk.ui.Component;

import br.com.vexillum.util.ReflectionUtils;
import br.com.vexillum.util.SpringFactory;
import br.eng.megaprojetos.control.PostController;
import br.eng.megaprojetos.model.Post;

@SuppressWarnings("serial")
@org.springframework.stereotype.Component
@Scope("prototype")
public class PostComposer extends BaseMegaComposer<Post, PostController>{
	
	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		loadBinder();
	}
	
	@Override
	protected String getUpdatePage() {
		return "/paginas/cargo/modalCadastrar.zul";
	}

	@Override
	protected String getDeactivationMessage() {
		return "Deseja desativar o Cargo?";
	}

	@Override
	public PostController getControl() {
		return SpringFactory.getController("postController", PostController.class, ReflectionUtils.prepareDataForPersistence(this));
	}

	@Override
	public Post getEntityObject() {
		return new Post();
	}
	
	
}
